<template>
    <form.vue v-if="fields && fields.length" :fields="fields" />
</template>

<script>
    import Form from "./form"
    export default {
        name: "form_setting",
        data(){
            return {
                fields: []
            }
        },
        components: {"form.vue":Form},
        mounted() {
            var t = this;
            window.addEventListener("message", function(msg) {
                try{
                    t.fields = JSON.parse(msg.data)
                } catch (e) {

                }
                console.log(msg)
            })
        }
    }
</script>

<style scoped>

</style>